package com.benefm.multipar.pad.model;

import com.benefm.multipar.pad.view.EcgWaveData;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.Objects;

public class PersonInfo implements Serializable {

    public String name;
    public String userId;
    public String sex;
    public String phone;
    public String birthday;

    public String mac;
    public String deviceMac;
    public String onlineStatus;
    public String offlineTime;

    public String cid;
    public String channelName;
    public String fileName;
    public String deviceSn;

    public ArrayList<EcgWaveData> data = new ArrayList<>();


    @Override
    public String toString() {
        return "PersonInfo{" +
                "name='" + name + '\'' +
                ", userId='" + userId + '\'' +
                ", phone='" + phone + '\'' +
                ", mac='" + mac + '\'' +
                ", deviceMac='" + deviceMac + '\'' +
                ", onlineStatus='" + onlineStatus + '\'' +
                ", offlineTime='" + offlineTime + '\'' +
                ", cid='" + cid + '\'' +
                ", channelName='" + channelName + '\'' +
                ", deviceSn='" + deviceSn + '\'' +
                '}';
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (!(o instanceof PersonInfo)) return false;
        PersonInfo info = (PersonInfo) o;
        return userId.equals(info.userId) && mac.equals(info.mac) && deviceMac.equals(info.deviceMac);
    }

    @Override
    public int hashCode() {
        return Objects.hash(userId, mac, deviceMac);
    }
}
